package my_class.reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class Test5 {
    public static void main(String[] args) throws ClassNotFoundException {
        Student student = new Student();
        String name = student.getName();
        System.out.println(name);
        System.out.println(student);
        Class<?> clazz = Class.forName("my_class.reflect.Student");
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            System.out.println(method);
        }
        System.out.println("==============================");
        Constructor<?>[] constructors = clazz.getDeclaredConstructors();
        for (Constructor<?> constructor : constructors) {
            System.out.println(constructor);
        }

    }
}
